package com.bailian.spring.ioc.basic_beanFactory;

import com.bailian.spring.ioc.basic_beanFactory.bean.Ball;
import com.bailian.spring.ioc.basic_beanFactory.config.BeanFactoryConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author gaoxu
 * date: Created on 2021/11/1 下午2:19
 */
public class BeanFactoryApplication {
    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(BeanFactoryConfig.class);
        Ball ball1 = ctx.getBean(Ball.class);
        System.out.println(ball1);

        Ball ball2 = ctx.getBean(Ball.class);
        System.out.println(ball2);
    }
}
